.class public Lcom/brixd/niceapp/activity/NiceAppContentActivity;
.super Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;
.source "NiceAppContentActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;
    }
.end annotation


# static fields
.field private static final ACTION_MORE:I = 0x1

.field private static final ACTION_SEARCH:I = 0x0

.field public static final TARGET_KEY:Ljava/lang/String; = "TargetFragment"


# instance fields
.field private mContentFragment:Landroid/support/v4/app/Fragment;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 35
    invoke-direct {p0}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;-><init>()V

    .line 39
    return-void
.end method

.method static synthetic access$000(Lcom/brixd/niceapp/activity/NiceAppContentActivity;)Landroid/support/v4/app/Fragment;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/NiceAppContentActivity;

    .prologue
    .line 35
    iget-object v0, p0, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->mContentFragment:Landroid/support/v4/app/Fragment;

    return-object v0
.end method

.method private performEvent(I)V
    .registers 6
    .param p1, "action"    # I

    .prologue
    const/4 v3, 0x1

    .line 196
    const/4 v0, 0x0

    .line 197
    .local v0, "intent":Landroid/content/Intent;
    if-nez p1, :cond_21

    .line 198
    new-instance v0, Landroid/content/Intent;

    .end local v0    # "intent":Landroid/content/Intent;
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getActivity()Landroid/app/Activity;

    move-result-object v1

    const-class v2, Lcom/brixd/niceapp/activity/NiceAppSearchActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 199
    .restart local v0    # "intent":Landroid/content/Intent;
    const-string v1, "dynamic_background"

    invoke-virtual {v0, v1, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 204
    :cond_14
    :goto_14
    if-eqz v0, :cond_20

    .line 205
    invoke-virtual {p0, v0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->startActivity(Landroid/content/Intent;)V

    .line 206
    const v1, 0x7f040016

    const/4 v2, 0x0

    invoke-virtual {p0, v1, v2}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->overridePendingTransition(II)V

    .line 209
    :cond_20
    return-void

    .line 200
    :cond_21
    if-ne p1, v3, :cond_14

    .line 201
    new-instance v0, Landroid/content/Intent;

    .end local v0    # "intent":Landroid/content/Intent;
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getActivity()Landroid/app/Activity;

    move-result-object v1

    const-class v2, Lcom/brixd/niceapp/activity/NiceAppSettingActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .restart local v0    # "intent":Landroid/content/Intent;
    goto :goto_14
.end method

.method private switchFragment(Landroid/support/v4/app/Fragment;Z)V
    .registers 5
    .param p1, "fragment"    # Landroid/support/v4/app/Fragment;
    .param p2, "showMenu"    # Z

    .prologue
    .line 217
    iput-object p1, p0, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->mContentFragment:Landroid/support/v4/app/Fragment;

    .line 218
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/FragmentManager;->beginTransaction()Landroid/support/v4/app/FragmentTransaction;

    move-result-object v0

    const v1, 0x7f0a006a

    invoke-virtual {v0, v1, p1}, Landroid/support/v4/app/FragmentTransaction;->replace(ILandroid/support/v4/app/Fragment;)Landroid/support/v4/app/FragmentTransaction;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/FragmentTransaction;->commit()I

    .line 220
    if-eqz p2, :cond_23

    .line 221
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getSlidingMenu()Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;

    move-result-object v0

    new-instance v1, Lcom/brixd/niceapp/activity/NiceAppContentActivity$3;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity$3;-><init>(Lcom/brixd/niceapp/activity/NiceAppContentActivity;)V

    invoke-virtual {v0, v1}, Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;->post(Ljava/lang/Runnable;)Z

    .line 248
    :goto_22
    return-void

    .line 239
    :cond_23
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getSlidingMenu()Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;

    move-result-object v0

    new-instance v1, Lcom/brixd/niceapp/activity/NiceAppContentActivity$4;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity$4;-><init>(Lcom/brixd/niceapp/activity/NiceAppContentActivity;)V

    invoke-virtual {v0, v1}, Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;->post(Ljava/lang/Runnable;)Z

    goto :goto_22
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .registers 5
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    .line 54
    invoke-super {p0, p1}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onCreate(Landroid/os/Bundle;)V

    .line 55
    const v1, 0x7f030010

    invoke-virtual {p0, v1}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->setContentView(I)V

    .line 58
    :try_start_9
    invoke-static {p0}, Lcom/brixd/niceapp/application/NiceAppApplication;->initImageLoader(Landroid/content/Context;)V
    :try_end_c
    .catch Ljava/io/IOException; {:try_start_9 .. :try_end_c} :catch_4a

    .line 63
    :goto_c
    invoke-static {}, Lcom/brixd/niceapp/util/SettingUtils;->isPushEnable()Z

    move-result v1

    if-eqz v1, :cond_19

    .line 64
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/brixd/niceapp/util/PushUtils;->startPush(Landroid/content/Context;)V

    .line 70
    :cond_19
    invoke-static {}, Lcom/brixd/niceapp/community/CommunityMainFragment;->getInstance()Lcom/brixd/niceapp/community/CommunityMainFragment;

    move-result-object v1

    const/4 v2, 0x1

    invoke-direct {p0, v1, v2}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->switchFragment(Landroid/support/v4/app/Fragment;Z)V

    .line 72
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getSlidingMenu()Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;

    move-result-object v1

    new-instance v2, Lcom/brixd/niceapp/activity/NiceAppContentActivity$1;

    invoke-direct {v2, p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity$1;-><init>(Lcom/brixd/niceapp/activity/NiceAppContentActivity;)V

    invoke-virtual {v1, v2}, Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;->setOnCloseListener(Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu$OnCloseListener;)V

    .line 91
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getSlidingMenu()Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;

    move-result-object v1

    new-instance v2, Lcom/brixd/niceapp/activity/NiceAppContentActivity$2;

    invoke-direct {v2, p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity$2;-><init>(Lcom/brixd/niceapp/activity/NiceAppContentActivity;)V

    invoke-virtual {v1, v2}, Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu;->setOnOpenListener(Lcom/jeremyfeinstein/slidingmenu/lib/SlidingMenu$OnOpenListener;)V

    .line 115
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->isUserLogin()Z

    move-result v1

    if-eqz v1, :cond_42

    .line 116
    invoke-static {p0}, Lcom/brixd/niceapp/sys/service/SyncService;->start(Landroid/content/Context;)V

    .line 119
    :cond_42
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/zuiapps/library/helper/ZMUpgradeHelper;->checkUpgradeAutomatically(Landroid/content/Context;)V

    .line 120
    return-void

    .line 59
    :catch_4a
    move-exception v0

    .line 60
    .local v0, "e":Ljava/io/IOException;
    const-string v1, "error_init_image"

    const-string v2, "main"

    invoke-static {p0, v1, v2}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_c
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .registers 4
    .param p1, "menu"    # Landroid/view/Menu;

    .prologue
    .line 164
    invoke-static {}, Lcom/zuiapps/suite/utils/device/DeviceUtil;->hasSmartBar()Z

    move-result v1

    if-eqz v1, :cond_10

    .line 165
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getMenuInflater()Landroid/view/MenuInflater;

    move-result-object v0

    .line 166
    .local v0, "inflater":Landroid/view/MenuInflater;
    const v1, 0x7f0e0001

    invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

    .line 169
    .end local v0    # "inflater":Landroid/view/MenuInflater;
    :cond_10
    invoke-super {p0, p1}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onCreateOptionsMenu(Landroid/view/Menu;)Z

    move-result v1

    return v1
.end method

.method protected onDestroy()V
    .registers 1

    .prologue
    .line 48
    invoke-static {p0}, Lcom/brixd/niceapp/sys/service/SyncService;->stop(Landroid/content/Context;)V

    .line 49
    invoke-super {p0}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onDestroy()V

    .line 50
    return-void
.end method

.method protected onNewIntent(Landroid/content/Intent;)V
    .registers 7
    .param p1, "intent"    # Landroid/content/Intent;

    .prologue
    .line 136
    invoke-super {p0, p1}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onNewIntent(Landroid/content/Intent;)V

    .line 138
    if-eqz p1, :cond_24

    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v3

    if-eqz v3, :cond_24

    .line 139
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 140
    .local v0, "bundle":Landroid/os/Bundle;
    const-string v3, "TargetFragment"

    invoke-virtual {v0, v3}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;

    .line 142
    .local v2, "target":Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;
    if-eqz v2, :cond_24

    .line 143
    sget-object v3, Lcom/brixd/niceapp/activity/NiceAppContentActivity$5;->$SwitchMap$com$brixd$niceapp$activity$NiceAppContentActivity$TargetFragment:[I

    invoke-virtual {v2}, Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;->ordinal()I

    move-result v4

    aget v3, v3, v4

    packed-switch v3, :pswitch_data_4c

    .line 160
    .end local v0    # "bundle":Landroid/os/Bundle;
    .end local v2    # "target":Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;
    :cond_24
    :goto_24
    return-void

    .line 145
    .restart local v0    # "bundle":Landroid/os/Bundle;
    .restart local v2    # "target":Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;
    :pswitch_25
    iget-object v3, p0, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->mFragment:Lcom/brixd/niceapp/activity/fragment/SideNavigationFragment;

    invoke-virtual {v3, v2}, Lcom/brixd/niceapp/activity/fragment/SideNavigationFragment;->updateSideNavItemState(Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;)Z

    .line 146
    invoke-static {v0}, Lcom/brixd/niceapp/community/CommunityMainFragment;->getInstance(Landroid/os/Bundle;)Lcom/brixd/niceapp/community/CommunityMainFragment;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->switchFragment(Landroid/support/v4/app/Fragment;)V

    goto :goto_24

    .line 150
    :pswitch_32
    iget-object v3, p0, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->mFragment:Lcom/brixd/niceapp/activity/fragment/SideNavigationFragment;

    invoke-virtual {v3, v2}, Lcom/brixd/niceapp/activity/fragment/SideNavigationFragment;->updateSideNavItemState(Lcom/brixd/niceapp/activity/NiceAppContentActivity$TargetFragment;)Z

    .line 151
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getCachedAppModelsJsonData()Lorg/json/JSONObject;

    move-result-object v1

    .line 152
    .local v1, "jsonData":Lorg/json/JSONObject;
    sget-object v3, Lcom/brixd/niceapp/constant/AppConstant$ModuleType;->NICE_DAILY:Lcom/brixd/niceapp/constant/AppConstant$ModuleType;

    invoke-static {v1, v3}, Lcom/brixd/niceapp/model/AppModel;->parseAppModels(Lorg/json/JSONObject;Lcom/brixd/niceapp/constant/AppConstant$ModuleType;)Ljava/util/ArrayList;

    move-result-object v3

    sget-object v4, Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;->DAILY_NICE_APP:Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;

    invoke-static {v3, v4}, Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment;->getDailyAppInstance(Ljava/util/ArrayList;Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;)Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->switchFragment(Landroid/support/v4/app/Fragment;)V

    goto :goto_24

    .line 143
    nop

    :pswitch_data_4c
    .packed-switch 0x1
        :pswitch_25
        :pswitch_32
    .end packed-switch
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .registers 4
    .param p1, "item"    # Landroid/view/MenuItem;

    .prologue
    .line 174
    invoke-static {}, Lcom/zuiapps/suite/utils/device/DeviceUtil;->hasSmartBar()Z

    move-result v0

    if-eqz v0, :cond_1b

    .line 175
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v0

    const v1, 0x7f0a01f6

    if-ne v0, v1, :cond_20

    .line 176
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getActivity()Landroid/app/Activity;

    move-result-object v0

    const-string v1, "ClickSearchFromSmartbar"

    invoke-static {v0, v1}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;)V

    .line 177
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->performSearchEvent()V

    .line 184
    :cond_1b
    :goto_1b
    invoke-super {p0, p1}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onOptionsItemSelected(Landroid/view/MenuItem;)Z

    move-result v0

    return v0

    .line 178
    :cond_20
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v0

    const v1, 0x7f0a01f7

    if-ne v0, v1, :cond_1b

    .line 179
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->getActivity()Landroid/app/Activity;

    move-result-object v0

    const-string v1, "ClickSettingFromSmartbar"

    invoke-static {v0, v1}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;)V

    .line 180
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->performMoreEvent()V

    goto :goto_1b
.end method

.method protected onPause()V
    .registers 2

    .prologue
    .line 130
    invoke-super {p0}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onPause()V

    .line 131
    invoke-static {}, Lcom/brixd/niceapp/bus/BusProvider;->getInstance()Lcom/squareup/otto/Bus;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/squareup/otto/Bus;->unregister(Ljava/lang/Object;)V

    .line 132
    return-void
.end method

.method protected onResume()V
    .registers 2

    .prologue
    .line 124
    invoke-super {p0}, Lcom/brixd/niceapp/activity/AbsBaseSlidingMenuActivity;->onResume()V

    .line 125
    invoke-static {}, Lcom/brixd/niceapp/bus/BusProvider;->getInstance()Lcom/squareup/otto/Bus;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/squareup/otto/Bus;->register(Ljava/lang/Object;)V

    .line 126
    return-void
.end method

.method public performMoreEvent()V
    .registers 2

    .prologue
    .line 192
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->performEvent(I)V

    .line 193
    return-void
.end method

.method public performSearchEvent()V
    .registers 2

    .prologue
    .line 188
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->performEvent(I)V

    .line 189
    return-void
.end method

.method public switchFragment(Landroid/support/v4/app/Fragment;)V
    .registers 3
    .param p1, "fragment"    # Landroid/support/v4/app/Fragment;

    .prologue
    .line 213
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/brixd/niceapp/activity/NiceAppContentActivity;->switchFragment(Landroid/support/v4/app/Fragment;Z)V

    .line 214
    return-void
.end method
